<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    let  list  = ["a","b","c","a","b","b"];
    //{a:2,b:3,c:1}
    let newArr  = Array.from(new Set(list));
    let  obj = {};
    newArr.forEach(item=>{
        obj[item] = list.filter(key=>item==key).length;
    })
    console.log(obj);
 
</script>
</html>